﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title></title>
	</head>
	<body>
	     <object id="xddd" name="xddd" classid="clsid:8d7d8518-ca58-4863-b94d-3c616fda7b35">
        </object>
         
        <input type="button" value="连接服务器" onclick="InitialActiveX()" />
        <input type="button" value="测试事件" onclick="TestEvent()" />
        <script type="text/javascript">
            function InitialActiveX() {
                xddd.ConnectServer("127.0.0.1", 9002);
            };
            function TestEvent() {
                xddd.TestEvent("yes，event fired");
            };
        </script>
        <script ID="clientEventHandlersForActivex" type="text/javascript" language="javascript" for="xddd" event="OnSystemComand2(sCommand)">
            alert(sCommand);
        </script> 
        <script ID="Script1" type="text/javascript" language="javascript" for="xddd" event="OnTestEvent(sCommand)">
            alert(sCommand);
        </script>
        
        <br /><br />
        
        <object id="UtilityActiveX" name="UtilityActiveX" classid="clsid:72DF4396-3C95-43BB-94C1-8BA61A987467">
        </object> 
        <input type="button" value="测试ActiveX调用js方法" onclick="CallJavaScript()" />

        <script type="text/javascript">
            function CallJavaScript() {
                UtilityActiveX.CallJavaScript("ShowMessage");
            };

            function ShowMessage(msg) {
                alert(msg);
            };
        </script>
	</body>
</html>